package com.guyaogg.gulimall.coupon;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;

/**
 *
 * 配置中心
 *  1. 依赖
 *      <dependency>
 *             <groupId>com.alibaba.cloud</groupId>
 *             <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
 *         </dependency>
 *  2.在 nacos 配置 空间、组、id、文件尾（yaml、properties
 *  3.在 bootstrap.yml 中配置，中心
 *           spring:
 *              cloud:
 *                nacos:
 *                  discovery:
 *                    server-addr: 192.168.10.200:8848
 *                  config:
 *                    server-addr: 192.168.10.200:8848
 *                    group: GULI_MALL_GROUP
 *                    namespace: d3239419-caf4-484d-bb0e-779460309792
 *                    file-extension: yaml
 *              application:
 *                name: gulimall-coupon
 *  4.@RefreshScope
 *    @Value 获取值，优先获取配置中心的值
 *
 *  5.同时加载多个配置集
 *      extension-configs:
 *           - data-id: conpon-test.yaml
 *             group: GULI_MALL_GROUP
 *             refresh: true
 *           - data-id: conpon-test2.yaml
 *             group: GULI_MALL_GROUP
 *             refresh: true
 *
 *      注意优先级：
 *          最高：首先配置的源文件，它的优先级最高，谁都不能覆盖他
 *          中等：配置集优先级顺序上升，后面的会覆盖前面有的配置
 *          最低：本地配置，上面会覆盖有的配置
 *
 *
 * @author 顾遥
 */
@EnableDiscoveryClient
@SpringBootApplication
@EnableFeignClients
public class GulimallCouponApplication {

    public static void main(String[] args) {
        SpringApplication.run(GulimallCouponApplication.class, args);
    }

}
